package personal.xjl._23java1studentdemo.mapper;

import org.apache.ibatis.annotations.*;
import personal.xjl._23java1studentdemo.model.Course;
import personal.xjl._23java1studentdemo.model.Score;
import personal.xjl._23java1studentdemo.model.Teacher;

import java.util.List;

@Mapper
public interface ScoreMapper {
    @Select("select * from score where student_id=#{student_id}")
    @Results({
            @Result(column = "course_id",property = "course",javaType = Course.class,
                    one = @One(select = "personal.xjl._23java1studentdemo.mapper.CourseMapper.selectById"))
    })
    public List<Score> selectByStudentId(int student_id);

    @Select("select * from score where course_id=#{course_id}")
    @Results({
            @Result(column = "course_id",property = "course",javaType = Course.class,
                    one = @One(select = "personal.xjl._23java1studentdemo.mapper.CourseMapper.selectById"))
    })
    public List<Score> selectByCourseId(int course_id);
}